
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    // 倒计时函数：根据输入的时间，给出当前时间距离输入时间的倒计时内容；
    // 效果：距离某个时间，还有 x天x时x分x秒
	let please = window.prompt("请输入一个时间我们即将开始倒计时");
   function Timetime(time){

        let Nowtime =+ new Date();//
        let Onetime =+ new Date(time);
        let Count = (Onetime - Nowtime)/1000;
		//
        if (Count<0){
            Count = Count*-1;
        }
		
        let days = parseInt(Count/60/60/24);
        let hours = parseInt(Count/60/60%24);
        let mnitus = parseInt(Count/60%60);
        let seconds = parseInt(Count%60);

        let times = `距离${please}还有${days}天${hours}时${mnitus}分${seconds}秒`
		return times

    }
	document.write(Timetime(please));
    </script>
</body>
</html>